#include<iostream>
#include<string>

using namespace std;                      
int  main()
{
string numeric("0123456789");
string name("r2d3");
string ::size_type pos=0;
while((pos=name.find_first_of(numeric,pos))!=string::npos)
{
                     cout<<"pos:"<<pos<<endl;
	cout<<name[pos]<<endl;
	++pos;
 }

	 string line1="We are her pride of 10 she named us: ";
	 string line2="Benjammin, Phonix, the Prodigal ";
	 string line3="and perspicacious pacific Suzann\n";

	string sentence=line1+line2+line3;
	string separate(" \t:,\v\r\n\f");
	int count=0;
	cout<<sentence<<endl;
	string::size_type startpos=0,endpos=0;
	int maxlen=0;
	int minlen=100;
	string word;

	while ((startpos=sentence.find_first_not_of(separate,endpos))!=string::npos)
	{
		++count;
		
		endpos=sentence.find_first_of(separate,startpos);
		int len=endpos-startpos;
		word.assign(sentence.begin()+startpos,sentence.begin()+endpos);
		if(len>maxlen)
			maxlen=len;
		else
			if (len<minlen)
			{
				minlen=len;
			}
		
		
	}
	cout<<maxlen<<" "<<minlen<<endl;
	cout<<count<<endl;

	return 0;
}
}